#include "Sampler.h"
#include "DXDevice.h"

Sampler::Sampler(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE wrap)
{
	samplerDesc.Filter = filter;
	samplerDesc.AddressU = wrap;
	samplerDesc.AddressV = wrap;
	samplerDesc.AddressW = wrap;
	samplerDesc.MipLODBias = 0.0f;
	samplerDesc.MaxAnisotropy = 1;
	samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
	samplerDesc.BorderColor[0] = 0;
	samplerDesc.BorderColor[1] = 0;
	samplerDesc.BorderColor[2] = 0;
	samplerDesc.BorderColor[3] = 0;
	samplerDesc.MinLOD = 0;
	samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
	DXDevice::GetInstance()->GetD3D11Device()->CreateSamplerState(&samplerDesc, &samplerState);
}
Sampler::~Sampler()
{
	SafeRelease(samplerState);
}